package com.example.vozdocidadao;








import android.os.Bundle;

import android.app.Activity;
import android.app.AlertDialog;

import android.view.KeyEvent;
import android.view.Menu;
import android.view.View;

import android.widget.Button;




public class VozdoCidadao extends Activity {


	
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
        TelaInicial();
        
		
		
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.inicial, menu);

		return true;
	}
	
	public void TelaInicial()
	{
		

		
		setContentView(R.layout.inicial);
			
		
        Button logvoz = (Button)findViewById(R.id.btnLog);
        logvoz.setOnClickListener(new View.OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				TelaLogin();
				
			}
		});
	}
	
	public void TelaLogin()
	{

		
		setContentView(R.layout.login);
		
		
	}
	
    public void exibeMensagem(String titulo, String msg){
    	AlertDialog.Builder mensagem = new AlertDialog.Builder(VozdoCidadao.this);
    	mensagem.setTitle(titulo);
    	mensagem.setMessage(msg);
    	mensagem.setNeutralButton("OK", null);
    	mensagem.show();
    	
    	
    	
    }
    
    public boolean onKeyDown(int keyCode, KeyEvent event)  
    {  
        //replaces the default 'Back' button action  
        if(keyCode==KeyEvent.KEYCODE_BACK && getCurrentFocus() != null)  
        {  
            //do whatever you want the 'Back' button to do  
            //as an example the 'Back' button is set to start a new Activity named 'NewActivity'  
            TelaInicial();
        	//setContentView(hist);
            //onBackPressed();            
        }  
        else
        {
        	onBackPressed();  
        }
        return true;  
    }  
	


}
